package com.hyj.springcloud.service;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.stereotype.Service;

@Service
public class PaymentService {
    @HystrixCommand(fallbackMethod = "timeout")
    public void notTimeout() {
        System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
    }

    public void timeout() {
        System.out.println("Thread.currentThread().getName() = " + Thread.currentThread().getName());
    }
}
